//
//  InfoTitleView.m
//  WeiYiMei
//
//  Created by 李叶夫 on 2019/4/20.
//  Copyright © 2019年 liyefu. All rights reserved.
//

#import "InfoTitleView.h"
#import "UIImage+Color.h"

@interface InfoTitleView ()

@property (nonatomic, strong) UIImageView *sep;

@end

@implementation InfoTitleView

- (void)setupSubViews
{
    self.titleLab = [[UILabel alloc] init];
    self.titleLab.textColor = kColor333333;
    self.titleLab.font = [UIFont boldSystemFontOfSize:15];
    [self addSubview:self.titleLab];
    
    self.sep = [[UIImageView alloc] init];
    self.sep.image = [UIImage gradientImageWithColorArray:@[(id)kColorGradientBegin.CGColor,(id)kColorGradientEnd.CGColor] beginPoint:CGPointMake(0, 0) endPoint:CGPointMake(30, 0) rect:CGRectMake(0, 0, 30, 2)];
    [self addSubview:self.sep];
}

- (void)setupConstraints
{
    [self.titleLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self);
        make.top.equalTo(self);
    }];
    
    [self.sep mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self);
        make.top.equalTo(self.titleLab.mas_bottom).offset(kWidth(7));
        make.width.equalTo(@30);
        make.height.equalTo(@2);
        make.bottom.equalTo(self);
    }];
}

@end
